﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using DAO;
using DTO;
namespace Banking.Member
{
    public partial class TaiKhoanVayCtrl : UserControl
    {
        public TaiKhoanVayCtrl()
        {
            InitializeComponent();
        }
        private TaiKhoanVay tk;
        public void Load(int ma)
        {
            btnUpdate.Enabled = false;
            btnUpdate.Visible = false;
             tk = TaiKhoanVayDA.GetByMaTKChinh(ma);
            if (tk != null)
            {   
                txtMaTaiKhoan.Text = tk.MaTKVay.ToString();
                double a=  Math.Round(tk.LSVay.MucLS,2);
                txtLaiSuat.Text = Convert.ToDouble(a).ToString();
               txtLoaiTien.Text = tk.Money.TenTien;
               txtNoiDung.Text = tk.NoiDungVay;
               a = Math.Round(tk.SoTienVay,2);
               txtSoTienVay.Text =a.ToString();

               dateNgayBatDau.Text = tk.NgayBatDau.ToString();
               dateNgayKetThuc.Text = tk.NgayKetThuc.ToString();
            }
            else
                MessageBox.Show("Khong Co tai khoan Vay", "BankingSystem ", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }

        private void btnTaiKhoanTC_Click(object sender, EventArgs e)
        {
            TaiKhoanTheChap f = new TaiKhoanTheChap();
            f.Load(tk.MaTKVay);
            f.Show();
        }

 
  

  



    }
}
